package com.zhuss.bean.bo.advice.Complaint;

import com.zhuss.common.AbstractBo;
import com.zhuss.common.BaseBo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @Author: zhushanshuo
 * @Date: 2020/3/6 11:31
 */
public class AssignedComplaintBo extends AbstractBo implements Serializable, BaseBo {

    private String complaintNo;

    private Long complaintId;

    private String content;

    private List<List<Long>> companyId;

    private List<Long> companyIdList;

    private List<Long> userIdList;

    private String person;

    private Date assignedTime;

    private Integer area;

    public String getComplaintNo() {
        return complaintNo;
    }

    public void setComplaintNo(String complaintNo) {
        this.complaintNo = complaintNo;
    }

    public Long getComplaintId() {
        return complaintId;
    }

    public void setComplaintId(Long complaintId) {
        this.complaintId = complaintId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getCompanyId() {
        StringBuffer sb = new StringBuffer();
        companyIdList = new ArrayList<>();
        userIdList = new ArrayList<>();
        for (List<Long> item : companyId) {
            companyIdList.add(item.get(0));
            if (item.size() < 2){
                continue;
            }else {
                userIdList.add(item.get(1));
            }
        }
        if (companyIdList != null && companyIdList.size() > 0) {
            for (Long item : companyIdList) {
                sb.append(item);
                sb.append(",");
            }
            sb.deleteCharAt(sb.lastIndexOf(","));
        }
        return sb.toString();
    }

    public void setCompanyId(List<List<Long>> companyId) {
        this.companyId = companyId;
    }

    public String getPerson() {
        StringBuffer sb = new StringBuffer();
        if (userIdList != null && userIdList.size() > 0) {
            sb.append(",");
            for (Long item : userIdList) {
                sb.append(item);
                sb.append(",");
            }
        }
        return sb.toString();
    }

    public void setPerson(String person) {
        this.person = person;
    }

    public Date getAssignedTime() {
        return assignedTime;
    }

    public void setAssignedTime(Date assignedTime) {
        this.assignedTime = assignedTime;
    }

    public Integer getArea() {
        area = getConcurrentArea();
        return area;
    }

    public void setArea(Integer area) {
        this.area = area;
    }
}
